package com.kerbores.meeting.domain;

import java.util.Set;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.ManyMany;
import org.nutz.dao.entity.annotation.Table;

/**
 * @author Kerbores
 *
 *         Create At 2015年1月12日 下午3:10:19
 */
@Table("nutz_role")
public class Role extends Entity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Column("name")
	private String name;

	@Column("description")
	private String description;

	/**
	 * 角色拥有一组权限
	 */
	@ManyMany(target = Permission.class, relation = "nutz_role_permission", from = "role_id", to = "permission_id")
	private Set<Permission> permissions;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the permissions
	 */
	public Set<Permission> getPermissions() {
		return permissions;
	}

	/**
	 * @param permissions
	 *            the permissions to set
	 */
	public void setPermissions(Set<Permission> permissions) {
		this.permissions = permissions;
	}

}
